package cn.school.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 试卷详情表
 * @TableName paper_detail
 */
@TableName(value ="paper_detail")
@Data
public class PaperDetail implements Serializable {
    /**
     * id
     */
    @TableId
    private Long id;

    /**
     * 题目id
     */
    private Integer questionId;

    /**
     * 试卷id
     */
    private Long paperId;

    /**
     * 图片路径
     */
    private String questionUrl;

    /**
     * 题目内容
     */
    private String questionDetail;

    /**
     * 题目分值
     */
    private Integer questionValue;

    /**
     * 题目标准答案
     */
    private String questionAnswer;

    /**
     * 逻辑删除
     */
    private Integer isDel;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PaperDetail other = (PaperDetail) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getQuestionId() == null ? other.getQuestionId() == null : this.getQuestionId().equals(other.getQuestionId()))
            && (this.getPaperId() == null ? other.getPaperId() == null : this.getPaperId().equals(other.getPaperId()))
            && (this.getQuestionUrl() == null ? other.getQuestionUrl() == null : this.getQuestionUrl().equals(other.getQuestionUrl()))
            && (this.getQuestionDetail() == null ? other.getQuestionDetail() == null : this.getQuestionDetail().equals(other.getQuestionDetail()))
            && (this.getQuestionValue() == null ? other.getQuestionValue() == null : this.getQuestionValue().equals(other.getQuestionValue()))
            && (this.getQuestionAnswer() == null ? other.getQuestionAnswer() == null : this.getQuestionAnswer().equals(other.getQuestionAnswer()))
            && (this.getIsDel() == null ? other.getIsDel() == null : this.getIsDel().equals(other.getIsDel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getQuestionId() == null) ? 0 : getQuestionId().hashCode());
        result = prime * result + ((getPaperId() == null) ? 0 : getPaperId().hashCode());
        result = prime * result + ((getQuestionUrl() == null) ? 0 : getQuestionUrl().hashCode());
        result = prime * result + ((getQuestionDetail() == null) ? 0 : getQuestionDetail().hashCode());
        result = prime * result + ((getQuestionValue() == null) ? 0 : getQuestionValue().hashCode());
        result = prime * result + ((getQuestionAnswer() == null) ? 0 : getQuestionAnswer().hashCode());
        result = prime * result + ((getIsDel() == null) ? 0 : getIsDel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", questionId=").append(questionId);
        sb.append(", paperId=").append(paperId);
        sb.append(", questionUrl=").append(questionUrl);
        sb.append(", questionDetail=").append(questionDetail);
        sb.append(", questionValue=").append(questionValue);
        sb.append(", questionAnswer=").append(questionAnswer);
        sb.append(", isDel=").append(isDel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}